package cn.gson.work.model.service;

import cn.gson.work.model.mapper.PejectsMapper;
import cn.gson.work.model.pojos.Category;
import cn.gson.work.model.pojos.Project;
import cn.gson.work.model.pojos.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProjectsService {
    @Autowired
    PejectsMapper pejectMapper;
    //查询项目
    public List<Project> All(String  USER_NAME){
        return pejectMapper.All(USER_NAME);
    }
    //新增加修改，根据ID值是否为空判断
    public void addP(Project project){
        System.out.println("项目信息"+project);
        if(project.getpId()!=0 ){
            pejectMapper.xg(project);
        }else {
            pejectMapper.addP(project);
        }

    }
    //项目类型
    public List<Category> cate(){
        return pejectMapper.cate();
    }
    //项目参与人员
    public List<User>  man(){
        return pejectMapper.man();
    }

}
